<!doctype html>
<html ng-app="myApp">
<head>
    <script src="../js/angular.min.js"></script>
</head>
<body>

Outside myDirective: {{ myProperty }}
<div my-directive ng-init="myProperty = 'wow, this is cool'">
    Inside myDirective: {{ myProperty }}
    <div>

        <script>
            angular.module('myApp', [])
                    .directive('myDirective', function() {
                        return {
                            restrict: 'A',
                            scope: {}
                        };
                    })
        </script>

</body>
</html>